"""API Q&A 相关功能实现模块"""
from fastapi import HTTPException

from service.qa_service import QaConfigService, QaFileService, QaService


class QaConfigServiceAPI(QaConfigService):
    """
    API 用于请求 QaConfigServiceAPI 实现类.  
    - 这个类是 API我们通过过度驱动实现与相关的特定异常处理.
    """

    def raise_exception(self, status_code: int = 400, detail: str = None, url: str = None):
        raise HTTPException(status_code=status_code, detail=detail)


class QaFileServiceAPI(QaFileService):
    """
    API 用于请求 QaFileService 实现类.  
    - 这个类是 API我们通过过度驱动实现与相关的特定异常处理.
    """
    def raise_exception(self, status_code: int = 400, detail: str = None, url: str = None):
        raise HTTPException(status_code=status_code, detail=detail)


class QaServiceAPI(QaService):
    """
    API 用于请求 QaService 实现类.  
    - 这个类是 API我们通过过度驱动实现与相关的特定异常处理.
    """

    def raise_exception(self, status_code: int = 400, detail: str = None, url: str = None):
        raise HTTPException(status_code=status_code, detail=detail)
